/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gm.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Med EL MOUDDENE
 */
@Embeddable
public class InscriptionAssociationPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_ASSOCIATION")
    private int idAssociation;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_PERSONNE")
    private int idPersonne;

    public InscriptionAssociationPK() {
    }

    public InscriptionAssociationPK(int idAssociation, int idPersonne) {
        this.idAssociation = idAssociation;
        this.idPersonne = idPersonne;
    }

    public int getIdAssociation() {
        return idAssociation;
    }

    public void setIdAssociation(int idAssociation) {
        this.idAssociation = idAssociation;
    }

    public int getIdPersonne() {
        return idPersonne;
    }

    public void setIdPersonne(int idPersonne) {
        this.idPersonne = idPersonne;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idAssociation;
        hash += (int) idPersonne;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InscriptionAssociationPK)) {
            return false;
        }
        InscriptionAssociationPK other = (InscriptionAssociationPK) object;
        if (this.idAssociation != other.idAssociation) {
            return false;
        }
        if (this.idPersonne != other.idPersonne) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.gm.entities.InscriptionAssociationPK[ idAssociation=" + idAssociation + ", idPersonne=" + idPersonne + " ]";
    }
    
}
